

<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/StepStatusAnalysis/stepStatusAnalysisStepTwo" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="stepStatusAnalysisStepTwo" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <label>工序编码：</label>
            %{--<g:select name="stepName" from="${stepStatusAnalysisStepTwoStepNameList}" data-toggle="selectpicker" data-live-search="true" optionKey="step_name" optionValue="step_name" value="${stepName}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="stepName" value="${stepName}"/>
            <label>工序名称：</label>
            %{--<g:select name="stepDesc2" from="${stepStatusAnalysisStepTwoStepDescList}" data-toggle="selectpicker" data-live-search="true" optionKey="step_desc" optionValue="step_desc" value="${stepDesc}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="stepDesc" value="${stepDesc}"/>
            <label>批次号：</label>
            %{--<g:select name="lotId" from="${stepStatusAnalysisStepTwoLotIdList}" data-toggle="selectpicker" data-live-search="true" optionKey="lot_id" optionValue="lot_id" value="${lotId}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="lotId" value="${lotId}"/>
            <label>存货编码：</label>
            %{--<g:select name="partName" from="${stepStatusAnalysisStepTwoPartNameList}" data-toggle="selectpicker" data-live-search="true" optionKey="savepartCode" optionValue="savepartCode" value="${partName}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="partName" value="${partName}"/>
            <label>产品名称：</label>
            %{--<g:select name="partDesc" from="${stepStatusAnalysisStepTwoPartDescList}" data-toggle="selectpicker" data-live-search="true" optionKey="part_desc" optionValue="part_desc" value="${partDesc}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="partDesc" value="${partDesc}"/>
            <label>内部图号：</label>
            %{--<g:select name="group3" from="${stepStatusAnalysisStepTwoGroupList}" data-toggle="selectpicker" data-live-search="true" optionKey="group3" optionValue="group3" value="${group3}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="group3" value="${group3}"/>
            <label>大组类：</label>
            %{--<g:select name="totalGroup" from="${stepStatusAnalysisStepTwoTotalGroupList}" data-toggle="selectpicker" data-live-search="true" optionKey="total_group" optionValue="total_group" value="${totalGroup}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="totalGroup" value="${totalGroup}"/>
            <label>小分类：</label>
            %{--<g:select name="detailCate" from="${stepStatusAnalysisStepTwoDetailCateList}" data-toggle="selectpicker" data-live-search="true" optionKey="detail_cate" optionValue="detail_cate" value="${detailCate}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="detailCate" value="${detailCate}"/>
            <input name="stepName1" type="hidden" value="${params.stepName1}"/>
            <input name="state1" type="hidden" value="${params.state1}"/>
            <input name="partName1" type="hidden" value="${params.partName1}"/>
            <input name="group31" type="hidden" value="${params.group31}"/>
            <input name="state" type="hidden" value="${params.state}"/>
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/StageWip/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="bjui-pageContent">

    <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">

        <thead>
        <tr>
            <g:each in="${tableHeadList}" status="j" var="headInstance">
                <g:if test="${headInstance!='RN'}">
                    <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                </g:if>
            </g:each>
        </tr>
        </thead>
        <tbody>
        <g:each in="${stepStatusAnalysisStepTwo}" status="i" var="dataInstance">
            <tr>
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance=='MAIN_QTY'&&headInstance!='RN'}">
                        <td name="lotqtyStep${i}">${dataInstance["${headInstance}"]}</td>
                    </g:if>
                    <g:if test="${headInstance=='STAY_TIME'&&headInstance!='RN'}">
                        <td name="staytime${i}">${dataInstance["${headInstance}"]}</td>
                    </g:if>
                    <g:elseif test="${headInstance!='RN'&&headInstance!='MAIN_QTY'}">
                        <td>${dataInstance["${headInstance}"]}</td>
                    </g:elseif>
                </g:each>
            </tr>

        </g:each>
        <tr>
            <td colspan="9">小计(当前页)</td>
            <td name="sumLotStep">0</td>
        </tr>
        <tr>
            <td colspan="9">合计(总)</td>
            <td>${stepStatusAnalysisStepTwoSum[0].SUM_QTY}</td>
        </tr>
        </tbody>
    </table>
</div>

<g:render template="../template/51pagination" />

<script>
    $(function(){
        var s2=0;
        for(var i=0;i<${stepStatusAnalysisStepTwo.size()};i++){
            var s3='lotqtyStep'+i
            var sumS1=$("td[name='"+s3+"']").text()==''?0:parseInt($("td[name='"+s3+"']").text())
            s2+=sumS1


        }
        $("td[name='sumLotStep']").html(s2)
        for(var i=0;i<${stepStatusAnalysisStepTwo.size()};i++){
            var nameStay="staytime"+i;
            var stayTime=parseFloat($("td[name='"+nameStay+"']").text())
            if(stayTime>=1&&stayTime<3){
                $("td[name='"+nameStay+"']").css("background-color","#FFFF6F")
                $("td[name='"+nameStay+"']").nextAll().css("background-color","#FFFF6F")
                $("td[name='"+nameStay+"']").prevAll().css("background-color","#FFFF6F")

            }else if(stayTime>=3&&stayTime<7){
                $("td[name='"+nameStay+"']").css("background-color","#FF9797")
                $("td[name='"+nameStay+"']").nextAll().css("background-color","#FF9797")
                $("td[name='"+nameStay+"']").prevAll().css("background-color","#FF9797")
            }else if(stayTime>=7){
                $("td[name='"+nameStay+"']").css("background-color","#FF5151")
                $("td[name='"+nameStay+"']").nextAll().css("background-color","#FF5151")
                $("td[name='"+nameStay+"']").prevAll().css("background-color","#FF5151")
            }
        }

    })
</script>